package tech.aistar.snake;

import java.util.Scanner;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/25 3:14 下午
 */
public class TestSnake {
    public static void main(String[] args) {
        SnakeDemo demo = new SnakeDemo();

        SnakeDemo.Snake s = demo.getSnake();

        Scanner sc = new Scanner(System.in);

        while(true){
            demo.startGame();
            String n = sc.nextLine();
            switch (n){
                case "w":
                    s.step(SnakeDemo.Snake.UP);
                    break;
                case "s":
                    s.step(SnakeDemo.Snake.DOWN);
                    break;
                case "a":
                    s.step(SnakeDemo.Snake.LEFT);
                    break;
                case "d":
                    s.step(SnakeDemo.Snake.RIGHT);
                    break;
            }

        }

    }
}
